import { defineConfig,loadEnv } from 'vite'
import path from "path";
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
export default ((mode) => {
	return defineConfig({
		optimizeDeps:{
			//打包忽略
			exclude:[],
			// 打包一定要包含
			include:[],
		},
		plugins: [
			uni(),
			
		],
		
		resolve: {
			alias: {
				"@": path.resolve(__dirname, "./src")
			}
		},
		
		server: {
			proxy: {
				// http://192.168.0.100:9305/dev-api
				"/dev-api": {
					target: loadEnv(mode, process.cwd()).VITE_APP_URL,
					changeOrigin: true,
					rewrite: (p) => p.replace(/^\/dev-api/, ""),
				},
			},
		},
	})
})